﻿using DBMode;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CMS
{
    public class AppInstance :BindableBase
    {
        private static AppInstance instance;

        /// <summary>
        /// 构造函数
        /// </summary>
        private AppInstance()
        {
            Roles.Add(new Role() { Name = "管理员", Type = 0 });
            Roles.Add(new Role() { Name = "员工", Type = 1 });
        }


        public static AppInstance GetInstance
        {
            get
            {
                if (instance == null)
                {
                    instance = new AppInstance();
                }
                return instance;
            }

        }

        private Member member = new Member();

        public Member Member
        {
            get { return member; }
            set { member = value; RaisePropertyChanged(); }
        }

        private List<Role> roles = new List<Role>();

        public List<Role> Roles
        {
            get { return roles; }
            set { roles = value; RaisePropertyChanged(); }
        }

        public class Role
        {

            public string Name { get; set; }
            public int Type { get; set; }
        }

    }
}
